<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>角色管理</title>
<script type="text/javascript" src="<%=basePath%>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/publicjs.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/jquery.colorbox.js"></script>
<link media="screen" rel="stylesheet" href="<%=basePath%>/css/colorbox.css" />

</head>

<body>
<table border=1>
<tr>
<td colspan="2"><input type="checkbox" name="checkbox11" id="checkbox11" />全选      &nbsp;&nbsp;
              <span style="cursor:pointer"  id="addrole" title="新增角色"><img src="<%=basePath%>/images/add.gif" width="10" height="10" /> 添加  </span> &nbsp; 
              <span style="cursor:pointer"  id="editrole" title="修改角色"><img src="<%=basePath%>/images/del.gif" width="10" height="10" /> 删除  </span>  &nbsp;&nbsp;
              <span style="cursor:pointer"  id="delrole" title="删除角色"><img src="<%=basePath%>/images/edit.gif" width="10" height="10" /> 编辑  </span> &nbsp;</span><span class="STYLE1"> &nbsp;</span></div></td>
</tr>
<tr>
<td width="22%" height="20" ><div align="center"><span >角色名称</span></div></td>
        <td width="34%" height="20" ><div align="center"><span>详细描述</span></div></td>
</tr>
<s:iterator value="page.list" status="state">
      <tr>
        <td height="20" ><div align="center">
          <input type="checkbox" name="checkbox2" id="checkbox2" value="<s:property value="id"/>"/>
        </div></td>
        <td height="30" ><div align="center"><span ><s:property value="rosename"/> </span></div></td>
        <td height="30" ><div align="center"><s:property value="des"/></div></td>
      </tr>
     </s:iterator>
     <tr>
        <td align="right" colspan="2">
        <div id="Pagination" class="pagination">
			<s:property  escape="false"  value="page.new08Nav2"/>
		</div>
        </td>
      </tr>
</table>
</body>
</html>
<script type="text/javascript">
<!--
$(function (){
//新增用户
$("#addrole").click(function() {
	$("#addrole").colorbox( {
		href : "addrole.do",width:"50%", height:"80%"
	});
});

//修改用户信息
$("#editrole").click(function() {
	var id = getCheckNum();
	if (id == "" || id.length == 0 || id.length > 1) {
		alert("请选择一条信息！");
		return false;
	} else {
		$("#editrole").colorbox( {
			href : "addrole.do?id=" + id
		});
	}
});

//删除用户信息
$("#delrole").click(function() {
	var id = getCheckNum();
	if (id == "" || id.length == 0) {
		alert("请选择要删除的信息！");
		return false;
	} else {
		if (!confirm("确定要删除这些信息吗？")) {
			return false;
		} else {
			$.getJSON("delrole.do?ids=" + id, function(data) {
				if (data == 0) {
					alert("删除成功！");
				} else {
					alert("删除失败！");
				}
				location = location;
			});
		}
	}
});
});
//-->
</script>
